/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

var menuElementShow = function(elem, show){
  var object = $(elem).children('.buttonDescription');
  if(object !== undefined){
    if(show){
      object.show(200);
    }
    else{
      object.hide(200);
    }
  }
}

var showSearch = function(elem, show){
	var elem = $(elem).children('.searchBody');
	if(!elem.is(':visible')){
		if(show){
			elem.show(200);
		}
	}
	else{
		if(!show){
			elem.hide(200);
		}
	}
}

$(document).ready(function(){
  $('.menubtn').mouseover(function(){
    menuElementShow(this, true);
  });
  $('.menubtn').mouseleave(function(){
    menuElementShow(this, false);
  });
  $('.searchButton').click(function(){
	showSearch(this, true);
  });
  $('.searchButton').mouseleave(function(){
	showSearch(this, false);
  });
  $('.iconsBox a').mouseover(function(){
	$(this).popover('show');
  });
  $('.iconsBox a').mouseleave(function(){
	$(this).popover('hide');
  });
});